package com.atguigu.gulimail.product;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;

/**
 * 1.整合mybatis-plus
 *      a.导入依赖
 *      b.配置
 *          1.配置数据源
 *              1.1 导入数据库驱动
 *              1.2 配置数据源
 *          2.配置mybatis-plus
 *
 *
 *       mybatis plus  逻辑删除
 *       1.配置全局的逻辑删除规则
 *        mybatis-plus:
 *         global-config:
           db-config:
             id-type:auto
             logic-delete-value:1
             logic-not-delete-value:0
          2.在实体类上加注逻辑删除注解 @TableLogic

 3.JSR303数据校验
    1.给bean添加校验注解
    2.开启校验功能@valid 或者 @Validated
    3.给校验的bean后面添加一个BindingResult对象作为入参,就可以获取到校验的结果
        例如:public R save(@RequestBody @Validated BrandEntity brand, BindingResult result){...}

 */
@EnableFeignClients(basePackages = "com.atguigu.gulimail.product.fegin")
@EnableDiscoveryClient
@MapperScan("com.atguigu.gulimail.product.dao")
@SpringBootApplication
public class GulimailProductApplication {

    public static void main (String[] args) {
        SpringApplication.run(GulimailProductApplication.class, args);
    }

}
